<?
//inculde即可以使用data数据。本页所有的data数据，倾在controller都处理好
include_once("../../../common/modules/checkA.php");
include_once("../../../../config.php");
include_once("../../../../api/miniapp/wxpay.php");
//引入所有子系统信息
include_once("../../../common/model/extender_import.php");

$act = $_REQUEST['act'];

if($act == 'refundOrder'){

    $nid = $_REQUEST['nid'];
    $price = $_REQUEST['price'];

    $wechat_info = select_one_line_all_items($table_Prefix.'app_wx','nid = 1');
    $wxpay = new Wxpay($wechat_info);

    $event_member_info = select_one_line_all_items($table_Prefix.'event_member','nid = '.$nid);

    $order_info = select_one_line_all_items($table_Prefix.'order_info',"order_id = '{$event_member_info['order_id']}'  and  order_status = 1 and pay_status = 1 ");

    $order_info['refund_price_admin'] =$price;

    if($order_info ){

      return  $wxpay->refundOrder($order_info);
    }


    $arr['status'] = 300;
    $arr['info'] = '退款失败';
    die(json_encode($arr)) ;

}
?>








